#include<stdio.h>
#include<math.h>

void find(int input,int zhishu[]);
int main(void)
{
	int times=0,flag=1,zhishu[303];
	
	for(int i=2;i<=2000;i++)
	{
		flag=1;
		for(int j=2;j<=sqrt(i);j++)
		{
			if(i%j==0)
			{
				flag=0;
			}
		}
		if(flag==1)
		{
			zhishu[times]=i;
			times++;
		}
	}
	
	int input;
	
	scanf("%d",&input);
	
	find(input,zhishu);
	
	return 0;
}
void find(int input,int zhishu[])
{
	for(int i=0;i<303;i++)
	{
		if(input%zhishu[i]==0&&input!=zhishu[i])
		{
			printf("%d ",zhishu[i]);
			input/=zhishu[i];
			find(input,zhishu);
			break;
		}
		else if(input%zhishu[i]==0&&input==zhishu[i])
		{
			printf("%d",zhishu[i]);
			break;
		}
	}
}
